package com.xpec.c4.service.module.h5gateway; 

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.xpec.c4.game.login.LoginModule;
import com.xpec.c4.message.MessageTypes;
import com.xpec.c4.service.annotations.MessageType;
import com.xpec.c4.service.contexts.Contexts;
//import com.xpec.c4.message.daemon.SSetGatewayStat;
//import com.xpec.c4.service.telnet.STelnetCmd;


/**
 * 
 */
public class H5GatewayAction 
{	
	private static final Log log = LogFactory.getLog(H5GatewayAction.class);

	private static long checkExpireTime = 0;

//	/**
//	 *
//	 */
//	@MessageType(typeCode = MessageTypes.S_TELNET_COMMAND)
//	public void setStatRequest(STelnetCmd obj)
//	{
//		GatewayModule module = (GatewayModule)Contexts.getModule();
//		if(module != null && obj != null && obj.guid != null){
//			module.procTelnetCommand(obj);
//		}
//	}
//
	@MessageType(typeCode = MessageTypes.S_SET_H5GATEWAY_SESSION)
	public void setSessionStatus(H5SetSessionStatus obj){
		H5GatewayModule module = (H5GatewayModule)Contexts.getModule();
		if(module != null && obj != null && obj.guid != null){
			module.setSessionStatus(obj.guid, obj.status);
		}		
		if(log.isInfoEnabled()){
			log.info(LoginModule.LOGIN_TRACE_LOG_STRING+" H5GateWay update Session, sessionID: "+obj.guid.toString());
		}
	}
//
//	@MessageType(typeCode = MessageTypes.S_DAEMON_SET_GATEWAY_STAT)
//	public void setGatewayStatus(SSetGatewayStat obj){
//		GatewayModule module = (GatewayModule)Contexts.getModule();
//		if(module != null){
//			module.setGatewayStatus(obj);
//		}		
//	}
}
